import { jwtDecode } from "jwt-decode"
import req from './request'

export const isLogin = () => {
    let token = window.sessionStorage.getItem('token')
    if (!token) {
        return false
    }
    jwtDecode(token, 'finance')
}

export const login = async (user_name, password) => {
    const res = await req.post('/users/login', {
        user_name,
        password
    })
    return res
}
